<?php

namespace App\Admin\Grid\Filter\Field;

class Text
{
    protected $placeholder = '';

    /**
     * 返回渲染该输入框所需的数据
     *
     * @return array
     */
    public function variables()
    {
        return [
            'placeholder' => $this->placeholder,
        ];
    }

    /**
     * 返回该输入框的类型,用来对应模板
     *
     * @return string
     */
    public function name()
    {
        return 'text';
    }

    /**
     * 设置该输入框的placeholder
     *
     * @param string $placeholder
     */
    public function setPlaceholder($placeholder)
    {
        $this->placeholder = $placeholder;
    }
}
